﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using BLL;
using Models;

namespace Workflow
{
    public partial class authoritySearch : System.Web.UI.Page
    {
        public List<UserTeamRole> resultList = new List<UserTeamRole>();
        private UserTeamRoleManager objUserTeamRoleManager = new UserTeamRoleManager();
        protected void Page_Load(object sender, EventArgs e)
        {

        }

        protected void btnSearch_Click(object sender, EventArgs e)
        {

            try
            {
                resultList = objUserTeamRoleManager.GetUserInfo(this.txtWorkName.Text.ToString().Trim(), this.txtDisplayName.Text.ToString().Trim());
                if(resultList.Count==0)
                {
                    string msg = string.Format("<script>alert('{0}')</script>", "没有找到任何信息");
                    Page.ClientScript.RegisterStartupScript(Page.GetType(), "alert", msg);
                }
            }
            catch (Exception ex)
            {
                string msg = string.Format("<script>alert('{0}')</script>", ex.Message);
                Page.ClientScript.RegisterStartupScript(Page.GetType(), "alert", msg);
            }
        }
    }
}